﻿
var VoiceRecorder = {
    // events
    onConnect : null,
    onRecord : null,
    onStop : null,
    onError : null,
    onPlay : null,  
    
    // methods
    /**
     * Invokes onConnect event. This method is intended for internal use only
     */
    _callOnConnect : function()
    {
        if (VoiceRecorder.onConnect != null)
            VoiceRecorder.onConnect();
    },
    
    /**
     * Invokes onConnect event. This method is intended for internal use only
     */
    _callOnRecord : function()
    {
        if (VoiceRecorder.onRecord != null)
            VoiceRecorder.onRecord();
    },
    
    /**
     * Invokes OnStop event. This method is intended for internal use only
     */
    _callOnStop : function(interval)
    {
        if (VoiceRecorder.onStop != null)
            VoiceRecorder.onStop(interval);
    },
    
    /**
     * Invokes OnError event. This method is intended for internal use only
     */
    _callOnError : function(code)
    {
        if (VoiceRecorder.onError != null)
            VoiceRecorder.onError(code);
    },
    
    /**
     * Invokes OnPlay event. This method is intended for internal use only
     */
    _callOnPlay : function()
    {
        if (VoiceRecorder.onPlay != null)
            VoiceRecorder.onPlay();
    }      
};